$(function(){
	setInterval("check()",10000);
});
var preCount=0;
function check(){
  var elem = document.getElementsByClassName("roll_div");
  if(elem != null && elem.length > 0)
  {return;}
  if(count==preCount){
      var divElement = document.createElement("div");
	  divElement.className="roll_div";
	  divElement.style.width=window.screen.availWidth;
	  divElement.style.height=window.screen.availHeight;
	  document.body.appendChild(divElement);
  }
  
  preCount=count;
}

function closeDiv()
{
	 var elem = document.getElementsByClassName("roll_div");
     for(var i = 0; i<elem.length;i++)
     {
          document.body.removeChild(elem[i]);
     }
}
var count=0;
document.onmousedown=function(){
	if(count==0){closeDiv();count=0;preCount=0;}
	else{count++;}
};

document.onkeydown=function(){
	if(count==0){closeDiv();count=0;preCount=0;}
	else{count++;}
};
